<template>
	<view class="container">
		<cu-custom :bgColor="globalColor" :isBack="true">
		    <block slot="content">解析记录</block>
		</cu-custom>
		<view class="cu-list menu sm-border" v-for="(item,index) in analyseList" :key="index">
			<view class="cu-item" @tap="detail(index)">
				<view class="content">
					<text class="text-grey">{{item.analyseUrl}}</text>
				</view>
			</view>
		</view>	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				analyseList:[],
				pageId:-1,
				globalColor: getApp().globalData.globalColor
			}
		},
		onLoad() {
			this.initAnalyseList(this.pageId)
		},
		methods: {
			initAnalyseList(pageId) {
				var that = this
				uni.request({
				    url: that.$reqUrl + 'lyz/getAnalyseList?pageId='+pageId+"&uid="+getApp().globalData.uid,
				    success: (res) => {
						console.log(res.data.data)
				        if(res.data.data.length > 0) {
							for(var i = 0;i<res.data.data.length;i++) {
								that.analyseList.push(res.data.data[i])
							}
							this.pageId = res.data.data[res.data.data.length-1].id
						}
				    }
				})
			},
			detail: function(index) {
				console.log(index)
				var copyData = this.analyseList[index].analyseUrl;
				uni.setClipboardData({
					data:copyData
				})
			}
		}
	}
</script>

<style>
	.container {
		padding-bottom: env(safe-area-inset-bottom);
	}

</style>
